package study.demo.MES;

import java.time.LocalDate;
import java.time.LocalTime;

public class ContrastUtil {
    /**
     * time包含
     */
    public static Boolean timeContainBoolean(LocalTime starTime, LocalTime endTime, LocalTime compareValue) {
        return timeGeBoolean(starTime, compareValue) && timeLeBoolean(endTime, compareValue);
    }

    /**
     * time大于等于
     */
    public static Boolean timeGeBoolean(LocalTime paramValue, LocalTime compareValue) {
        return timeGtBoolean(paramValue, compareValue) || timeEqBoolean(paramValue, compareValue);
    }

    /**
     * time小于等于
     */
    public static Boolean timeLeBoolean(LocalTime paramValue, LocalTime compareValue) {
        return timeLtBoolean(paramValue, compareValue) || timeEqBoolean(paramValue, compareValue);
    }

    /**
     * time小于
     */
    public static Boolean timeLtBoolean(LocalTime paramValue, LocalTime compareValue) {
        return compareValue.isBefore(paramValue);
    }

    /**
     * time大于
     */
    public static Boolean timeGtBoolean(LocalTime paramValue, LocalTime compareValue) {
        return compareValue.isAfter(paramValue);
    }

    /**
     * time等于
     */
    public static Boolean timeEqBoolean(LocalTime paramValue, LocalTime compareValue) {
        return compareValue.equals(paramValue);
    }

    /**
     * date包含
     */
    public static Boolean dateContainBoolean(LocalDate starTime, LocalDate endTime, LocalDate compareValue) {
        return dateGeBoolean(starTime, compareValue) && dateLeBoolean(endTime, compareValue);
    }

    /**
     * date大于等于
     */
    public static Boolean dateGeBoolean(LocalDate paramValue, LocalDate compareValue) {
        return dateGtBoolean(paramValue, compareValue) || dateEqBoolean(paramValue, compareValue);
    }

    /**
     * date小于等于
     */
    public static Boolean dateLeBoolean(LocalDate paramValue, LocalDate compareValue) {
        return dateLtBoolean(paramValue, compareValue) || dateEqBoolean(paramValue, compareValue);
    }

    /**
     * date小于
     */
    public static Boolean dateLtBoolean(LocalDate paramValue, LocalDate compareValue) {
        return compareValue.isBefore(paramValue);
    }

    /**
     * date大于
     */
    public static Boolean dateGtBoolean(LocalDate paramValue, LocalDate compareValue) {
        return compareValue.isAfter(paramValue);
    }

    /**
     * date等于
     */
    public static Boolean dateEqBoolean(LocalDate paramValue, LocalDate compareValue) {
        return paramValue.isEqual(paramValue);
    }


}
